package com.xj.demo.repository;

import com.xj.demo.entity.EsBlog;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

/**
 * <p> 继承ElasticSearchRepository的基本接口 </p>
 *
 * @author xujj
 * @description
 * @date 2024/4/7 9:53
 */
public interface EsBlogRepository extends ElasticsearchRepository<EsBlog, String> {


    @Query("{\"match\": {\"title\": {\"query\": \"?0\"}}}")
    Page<EsBlog> findByTitle(String title, Pageable pageable);
}
